package com.tebiecloud.mpweixin.client.service;

import com.tebiecloud.common.model.ResultBody;
import com.tebiecloud.mpweixin.client.model.entity.MpweixinUser;
import com.tebiecloud.mpweixin.client.model.mpweixin.QrcodeParam;
import com.tebiecloud.mpweixin.client.model.mpweixin.QrcodeTicket;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 公众号接口
 * @Author: tebie
 * @Date: 2019-09-10 10:40
 */
public interface IMpweixinApiServiceClient {

    /**
     * 网页授权，拉取用户信息(需scope为 snsapi_userinfo)
     * @param appid
     * @param openid
     * @param accessToken
     * @return
     */
    @PostMapping("/feign/api/infoMpweixinUser")
    ResultBody<MpweixinUser> getMpweixinUser(@RequestParam("appid") String appid,
                                             @RequestParam("openid") String openid,
                                             @RequestParam("accessToken") String accessToken);

    /**
     * 创建二维码
     * @param data QrcodeParam类对应的json字符串
     * @return
     */
    @PostMapping("/feign/api/createQrcode")
    ResultBody<QrcodeTicket> createQrcode(@RequestParam("data") String data);

    /**
     * 推送微信消息
     * @param data SendMpMsgInfo类对应的json字符串
     * @return
     */
    @PostMapping("/feign/api/sendMpMsg")
    ResultBody sendMpMsg(@RequestParam("data") String data);

}
